.class public Lcom/brixd/niceapp/sys/service/SyncService;
.super Landroid/app/IntentService;
.source "SyncService.java"


# instance fields
.field private mRunning:Z


# direct methods
.method public constructor <init>()V
    .registers 2

    .prologue
    .line 26
    const-string v0, "SyncService"

    invoke-direct {p0, v0}, Landroid/app/IntentService;-><init>(Ljava/lang/String;)V

    .line 27
    return-void
.end method

.method public static start(Landroid/content/Context;)V
    .registers 3
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 16
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/brixd/niceapp/sys/service/SyncService;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 17
    .local v0, "intent":Landroid/content/Intent;
    invoke-virtual {p0, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 18
    return-void
.end method

.method public static stop(Landroid/content/Context;)V
    .registers 3
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 21
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/brixd/niceapp/sys/service/SyncService;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 22
    .local v0, "intent":Landroid/content/Intent;
    invoke-virtual {p0, v0}, Landroid/content/Context;->stopService(Landroid/content/Intent;)Z

    .line 23
    return-void
.end method


# virtual methods
.method public onDestroy()V
    .registers 2

    .prologue
    .line 51
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/brixd/niceapp/sys/service/SyncService;->mRunning:Z

    .line 52
    invoke-super {p0}, Landroid/app/IntentService;->onDestroy()V

    .line 53
    return-void
.end method

.method protected onHandleIntent(Landroid/content/Intent;)V
    .registers 6
    .param p1, "intent"    # Landroid/content/Intent;

    .prologue
    .line 31
    :cond_0
    :goto_0
    iget-boolean v1, p0, Lcom/brixd/niceapp/sys/service/SyncService;->mRunning:Z

    if-eqz v1, :cond_18

    .line 32
    const-wide/32 v2, 0xdbba0

    invoke-static {v2, v3}, Landroid/os/SystemClock;->sleep(J)V

    .line 33
    iget-boolean v1, p0, Lcom/brixd/niceapp/sys/service/SyncService;->mRunning:Z

    if-eqz v1, :cond_0

    .line 34
    invoke-static {}, Lcom/brixd/niceapp/service/UserService;->getLoginUser()Lcom/brixd/niceapp/model/UserModel;

    move-result-object v0

    .line 35
    .local v0, "userModel":Lcom/brixd/niceapp/model/UserModel;
    if-eqz v0, :cond_0

    .line 36
    invoke-static {v0}, Lcom/brixd/niceapp/service/UserService;->checkMessages(Lcom/brixd/niceapp/model/UserModel;)V

    goto :goto_0

    .line 41
    .end local v0    # "userModel":Lcom/brixd/niceapp/model/UserModel;
    :cond_18
    return-void
.end method

.method public onStart(Landroid/content/Intent;I)V
    .registers 4
    .param p1, "intent"    # Landroid/content/Intent;
    .param p2, "startId"    # I

    .prologue
    .line 45
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/brixd/niceapp/sys/service/SyncService;->mRunning:Z

    .line 46
    invoke-super {p0, p1, p2}, Landroid/app/IntentService;->onStart(Landroid/content/Intent;I)V

    .line 47
    return-void
.end method
